#include<unordered_map>
#include<iostream>
using namespace std;
void getData(unordered_map<char,int>&m,int n){
    for(int i=0;i<n;i++)
        if(i%2)m.insert({'a'+i,rand()%100});
        else m['a'+i]=i+1;
}
void putData(unordered_map<char,int>m,string str){
    cout<<str;
    for(auto val:m)
        cout<<"key:"<<val.first<<"\tval:"<<val.second<<endl;
}
int main(){
    unordered_map<char,int>um;
    getData(um,20);
    putData(um,"原始数据：");
    auto air=um.find('d');
    if(air!=um.end()){
        cout<<"查找"<<air->first<<"的值为："<<air->second<<endl;
        um.erase(air);
        putData(um,"删除元素：");
    }
    cout<<"键为a的数据值为："<<um.at('a')<<endl;
    return 0;
}